from PID import *
#按键参数# 
button1_flag = 0
up_flag = 0
down_flag = 0
left_flag = 0
right_flag = 0
mid_flag = 0

direct_up_Count = 0
direct_right_Count = 0
direct_left_Count = 0
direct_down_Count = 0
direct_mid_Count = 0
direct_button1_Count = 0

#编码器参数# 
Real_speed = 0
Speed_L = 0
Speed_R = 0
imu_data = None
Cursor_Show = 1
Gyro = {
    "ax": 0,
    "ay": 0,
    "az": 0,
    "gx": 0,
    "gy": 0,
    "gz": 0,
    "gx_bias": 0,
    "gy_bias": 0,
    "gz_bias": 0,
}
Image_Show = 0
Normal_Go = 0
Table_Go = 0
Test_Go = 0
Car_Go = 0
Speed_Go = 0
Mode = 0
ccd_data1 = [0] * 128
ccd_data2 = [0] * 128
ccd_data3 = [0] * 128
Param_dict = {}
keys_list = []
Param_names = ["AccKp", "AccKi","AccKd",
               "AnKp", "AnKi", "AnKd",
               "Ac_TKp", "Ac_TKd", "speed",
               "sKp", "sKi", "sKd", "Mid",
               "dy_p", "st_p", "st_d", "st_d2",
               "L_dif","R_dif",
               "c1_cbh", "c2_cbh","c3_cbh",
               "c1_avth", "c2_avth","c3_avth",
               "cro1L", "cro1R","cro2L","cro2R",
               "Is_sp","Is_Tp","Is_Td",
               "L_Is","R_Is",
               "LIs1","RIs1","LIs2","RIs2","LIs3","RIs3",
               "LIs4","RIs4","LIs5","RIs5","LIs6","RIs6",
               "c1_max","c2_max","c3_max",
               "c1_ave","c2_ave","c3_ave",
               "Realim","L_lim","R_lim",
               "beep","Zebra","Rmp","check","block","blk_bu","blknum","blkcot",
               "Rmp_sp","Rmp_skp","Rmp_tkp","Rmp_cot","Rmp_mid1","Rmp_mid2",
               "Slow","Slocot1","Slocot2","SloOut","SloIn","outave","outcbh",
               "mode","ac_p","an_p","Slomid","G_cot1","G_cot2","green1","green2"
               ]
c1_cbh = 0
c2_cbh = 0
c3_cbh = 0
c1_avth = 0
c2_avth = 0
c3_avth = 0

Stop_start = 0
Cal_Angle = 0
Mid_Angle = 0
acc_ratio = 0
gyro_ratio = 0

L_dif = 0
R_dif = 0